home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 82 / CD-ROM 82 / CD-ROM 82.iso / infantil / tvnuts / TVNuts.exe / TVNuts.dcr / Internal_120_b_BackscreenLoop.ls < prev    next >
Encoding:
Text File  |  2002-02-04  |  2.7 KB  |  111 lines

  1. property pGame, pUrl, pScoreField, pScore, pScoreMod, pErrorChar, pClickOnOnce, pCheckStart
  2. global gEmail1, gBanSecs, gPlace, gSpot, gGameStatus, gGameOver, gPlay, gEmailNames, gMyNetID, gGameSeconds, key1, gScore
  3.  
  4. on beginSprite me
  5.   updateStage()
  6.   sprite(3).visible = 1
  7.   stop(sound(1))
  8.   put gScore into member "t_EndScore"
  9.   put "YourFriend@somewhere.com" into member "f_Emailbox1"
  10.   put EMPTY into member "f_Emailbox2"
  11.   put EMPTY into member "f_Emailbox3"
  12.   put EMPTY into member "f_Emailbox4"
  13.   put EMPTY into member "f_Emailbox5"
  14. end
  15.  
  16. on exitFrame me
  17.   go(the frame)
  18.   checkGameTime()
  19. end
  20.  
  21. on flashButton me, Action
  22.   case Action of
  23.     "PlayAgain":
  24.       puppetSound(3, "buttondown")
  25.       key1 = random(999999)
  26.       if gPlay = 1 then
  27.         pClickOnOnce = 1
  28.         ping()
  29.         gScore = 0
  30.         gGameStatus = "Paused"
  31.         gGameOver = 0
  32.         go("Game")
  33.         updateStage()
  34.       else
  35.         gPlay = 1
  36.         go("Legal")
  37.       end if
  38.     "Submit":
  39.       submitEmail(me)
  40.     "Kewl":
  41.       gsOpenURL("http://www.kewlbox.com")
  42.     "Score":
  43.       pGame = gScore
  44.       pUrl = "http://www.kewlbox.com/scores/direct.cfm?gameId=55&clientId=9"
  45.       pScore = "t_EndScore"
  46.       setScoreParams(me)
  47.       postMe(me)
  48.     "Quit":
  49.       puppetSound(3, "buttondown")
  50.       ping2()
  51.       go("End")
  52.     "Rollover":
  53.       puppetSound(3, "buttonover")
  54.   end case
  55. end
  56.  
  57. on ping me
  58.   if pClickOnOnce = 1 then
  59.     gMyNetID = getNetText("http://www.kewlbox.com/ping/ping.cfm?gameId=55&clientId=9")
  60.     if netError() = "OK" then
  61.       put "OK"
  62.     end if
  63.     pCheckStart = 1
  64.     pClickOnOnce = 0
  65.   end if
  66. end
  67.  
  68. on ping2 me
  69.   gMyNetID = getNetText("http://www.kewlbox.com/ping/end.cfm?gameId=55&clientId=9&time=" & gGameSeconds)
  70.   if netError() = "OK" then
  71.     put "OK"
  72.   end if
  73. end
  74.  
  75. on submitEmail me
  76.   gEmailNames = EMPTY
  77.   pErrorChar = [1: "\", 2: "\", 3: "#", 4: "?", 5: "%", 6: "\\", 7: "/"]
  78.   repeat with i = 1 to 5
  79.     box = "f_EmailBox" & i
  80.     if member(box).text = EMPTY then
  81.       next repeat
  82.       next repeat
  83.     end if
  84.     put "&" & "email" & i & "=" & member(box).text after gEmailNames
  85.   end repeat
  86.   repeat with y = 1 to 2
  87.     z = getProp(pErrorChar, y)
  88.     repeat with x = 1 to 200
  89.       if gEmailNames.char[x] = "$" then
  90.         delete gEmailNames.char[x]
  91.       end if
  92.     end repeat
  93.   end repeat
  94.   gsOpenURL("http://www.kewlbox.com/email/direct.cfm?gameId=55&clientId=9" & gEmailNames)
  95. end
  96.  
  97. on setScoreParams me
  98.   pScoreMod = gScore mod 10000
  99.   key2 = (4 * (pScoreMod * pScoreMod)) + (23 * pScoreMod) + (key1 * 54)
  100.   key2 = key2 mod 1000000
  101.   t = "&score=" & gScore
  102.   t = t & "&key1=" & key1
  103.   t = t & "&key2=" & key2
  104.   return t
  105. end
  106.  
  107. on postMe me
  108.   put pUrl
  109.   gsOpenURL(pUrl & setScoreParams(me))
  110. end
  111.